﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ComeSeeThis_MVC2.Models
{
    public partial class Motor
    {
        private readonly MotorRepository _repository = new MotorRepository();

        public IQueryable<Motor> MotorListThatHaveFdrs(int vehicleTypeId)
        {
            return _repository.GetMotorsThatHaveFdrs().Where(g => GearingRecs.Where(vt => vt.VehicleTypeId == vehicleTypeId).Any());
        }

        public IQueryable<Motor> MotorListThatHaveFdrs(int vehicleId, int nothing)
        {
            return _repository.GetMotorsThatHaveFdrs().Where(g => GearingRecs.Where(v => v.VehicleId == vehicleId).Any());
        }
    }
}